Imports System.ComponentModel

Public Class txt
    Inherits TextBox
    'Private _setFocus As New Windows.Forms.Control

    '<Description("Pilih control untuk set focus"), Category("My Property")> _
    'Public Property setFocus() As Windows.Forms.Control
    '    Get
    '        Return _setFocus
    '    End Get
    '    Set(ByVal value As Windows.Forms.Control)
    '        _setFocus = value
    '    End Set
    'End Property

    'Private Sub TextBoxHandle_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
    '    If CInt(AscW(e.KeyChar)) = 39 Then
    '        e.KeyChar = Chr(96)
    '        'ElseIf CInt(AscW(e.KeyChar)) = 40 Or CInt(AscW(e.KeyChar)) = 41 Then
    '        '    e.Handled = True
    '    End If

    '    If e.KeyChar = Chr(13) And Not _setFocus Is Nothing Then _setFocus.Focus()
    'End Sub

    Private Sub AgTextBox_MouseHover(sender As Object, e As EventArgs) Handles Me.MouseHover
        If Me.ReadOnly = True Then
            Me.BackColor = Color.LightPink
        Else
            Me.BackColor = Color.LightGreen
        End If
    End Sub

    Private Sub AgTextBox_MouseLeave(sender As Object, e As EventArgs) Handles Me.MouseLeave
        Me.BackColor = Color.White
    End Sub
End Class
